#ifndef __ACCEPTOR_H__
#define __ACCEPTOR_H__
#include "Socket.h"
#include "InetAddress.h"

#include <string>

using std::string;

class Acceptor
{
public:
    Acceptor(const string &ip, unsigned short port);
    ~Acceptor();
    void ready();
    int accept();
    int fd();
private:
    void setReuseAddr();
    void setReusePort();
    void bind();
    void listen();

    Socket _sock;
    InetAddress _addr;

};


#endif
